#ifndef _CUDA_CONTROLLER_H_
#define _CUDA_CONTROLLER_H_
#include <GL/glew.h>
#include <GL/glut.h>

class cuda_controller
{
private:
    // this buffer is used to connect CUDA and openGL
    GLuint __pixel_buffer;
    
    // the ray-tracing result is copied to this openGL texture
    GLuint __result_texture;
    
public:
    cuda_controller();
    ~cuda_controller();
    
    inline GLuint* pixel_buffer() { return &__pixel_buffer; }
    inline GLuint* result_texture() { return &__result_texture; }
    
    bool init();
    bool register_buffer();
    bool recalculate();
};

#endif